<style>

    .setimg{

        margin:-2px 5px 0 0

    }
    input { width: 100px; margin-right: 10px;}
    .input-medium {
        width: 100px;
    }

</style>

<div class="row-fluid">

    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>

    <div class="well">

        <div class="btn-toolbar">
            <form>
                <input class="input input-medium" type="text" name="order_id" placeholder="领用单号" value="<?=I('get.order_id')?>" />
                <!--<input class="input input-medium" type="text" name="use_class" placeholder="领用课别" value="<?=I('get.use_class')?>" />-->
                <input class="input input-medium" type="text" name="group_place" placeholder="领用地点" value="<?=I('get.group_place')?>" />
                <label style="display: inline;margin-left:10px">领取日期：</label>
                <input readonly name="start_date" placeholder="开始日期" class="input input-medium"
                       onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.start_date')?>"/>
                -<input readonly name="end_date" placeholder="结束日期" class="input input-medium"
                        onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.end_date')?>"/>

                <input type="hidden" value="<?=I('get.res')?>" name="res" />
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>
        </div>
        <a href="/take/takeMaterialAdd?res=2-2"><button class="btn btn-primary" style="float:right;padding:3px 6px">添加耗材领用</button></a>
        <table class="table">
            <thead>

            <tr>

                <th style="text-align:center;width:100px">序号</th>
                <th style="text-align:center;width:170px">领用单号</th>
                <th style="text-align:center;width:170px">领用地点</th>
                <th style="text-align:center;width:140px">领用日期</th>
                <th style="text-align:center;width:140px">领取人</th>
                <th style="text-align:center;width:140px">备注</th>
                <th style="text-align:center;width:140px">操作账号</th>
                <th style="text-align:center;width:140px">创建日期</th>

                <th style="text-align:center;width:130px">操作</th>

            </tr>

            </thead>

            <tbody>

            <?php if($getData){foreach($getData AS $key=>$val){ ?>

            <tr>

                <td style="text-align:center;vertical-align:middle;"><?=$val['id']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['order_id'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['take_place'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['take_date'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['take_users'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['remark'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['operator'] ?: '-'?></td>
                <td style="text-align:center;vertical-align:middle;"><?=date('Y-m-d H:i:s',$val['add_at'])?></td>

                <td style="text-align:center;vertical-align:middle;">
                    <a href="/take/takeMaterialAdd/id/<?=$val['id']?>/orderid/<?=$val['order_id']?>?res=2-2"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
                </td>

            </tr>

            <?php }}else{?>

            <tr><td style="text-align:center" colspan=11>暂无数据</td></tr>

            <?php }?>

            </tbody>

        </table>

        <span style="float:right;margin-top:-44px"><?=$page?></span>

    </div>

</div>

<script>

    $(function(){

        $('#setApply').change(function(){

            if($(this).val() != '0'){

                var strs = <?=json_encode($jsonArr)?>;

                var html = '<select name="city" id="appCity" style="width:125px;margin-left:5px">';

                for(var i=0;i<strs[$(this).val()].length;i++){

                    html += '<option value="'+strs[$(this).val()][i]['city']+'">'+strs[$(this).val()][i]['city']+'('+strs[$(this).val()][i]['cnt']+')</option>';

                }

                html += '</select>';

                $('#appCity').remove();

                $(html).insertAfter($('#setApply'));

            <?php if(I('get.city')){?>

                    $('#appCity').val('<?=I('get.city')?>');

                <?php }?>

            }

        }).trigger('change');

        $('.decate').live('click',function(){

            if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){

                return false;

            }

            window.location = $(this).attr('href');

        });

        $('.setTag').click(function(){

            if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){

                return false;

            }

            window.location = $(this).attr('href');

        });



        $('.lineCount').click(function(){

            art.dialog.open('/index/level/ifm/1/',

                {

                    id: 'SETCHOSEID',

                    width: '100%',

                    height: '100%',

                    left: '0%',

                    top: '0%',

                    fixed: true,

                    resize: false,

                    drag: false,

                    title: '用户等级'

                });

        });

    })

</script>